home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Applications 2002 November / SGI IRIX 6.5 Applications 2002 November.iso / dist / mpi.idb / usr / include / mpio.h.z / mpio.h
Encoding:
C/C++ Source or Header  |  2002-05-09  |  17.3 KB  |  432 lines

  1. /*
  2.  *      (C) COPYRIGHT SILICON GRAPHICS, INC.
  3.  *      UNPUBLISHED PROPRIETARY INFORMATION.
  4.  *      ALL RIGHTS RESERVED.
  5.  */
  6.  
  7. /* 
  8.  *   $Id: mpio.h,v 1.11 2002/04/10 18:43:58 tds Exp $    
  9.  *
  10.  *   Copyright (C) 1997 University of Chicago. 
  11.  */
  12.  
  13. /* user include file for MPI-IO programs */
  14.  
  15. #ifndef __MPIO_INCLUDE
  16. #define __MPIO_INCLUDE
  17.  
  18. #ifdef __linux
  19. #include <bits/types.h>
  20. #else
  21. #include <sgidefs.h>
  22. #endif
  23.  
  24. #include "mpi.h"
  25.  
  26. #if defined(__cplusplus)
  27. extern "C" {
  28. #endif
  29.  
  30. #define ROMIO_VERSION 103      /* Version 1.0.3 */
  31.  
  32. /* define MPI-IO datatypes and constants */
  33.  
  34. typedef struct ADIOI_FileD *MPI_File;
  35.  
  36. /* no generalized requests as yet */
  37. typedef struct ADIOI_RequestD *MPIO_Request;  
  38.  
  39. #ifdef __linux
  40. typedef long long MPI_Offset;
  41. #else
  42. typedef __int64_t MPI_Offset;
  43. #endif
  44.  
  45. #ifndef __NEEDS_MPI_FINT
  46.  
  47. #endif
  48. #ifdef __NEEDS_MPI_FINT
  49. typedef int MPI_Fint; 
  50. #endif
  51.  
  52. #ifndef __HAS_MPI_INFO
  53. #define __HAS_MPI_INFO
  54. #endif
  55. #ifndef __HAS_MPI_INFO
  56.   typedef struct MPIR_Info *MPI_Info;
  57. # define MPI_INFO_NULL         ((MPI_Info) 0)
  58. # define MPI_MAX_INFO_KEY       255
  59. # define MPI_MAX_INFO_VAL      1024
  60. #endif
  61.  
  62. #define MPI_MODE_RDONLY              2  /* ADIO_RDONLY */
  63. #define MPI_MODE_RDWR                8  /* ADIO_RDWR  */
  64. #define MPI_MODE_WRONLY              4  /* ADIO_WRONLY  */
  65. #define MPI_MODE_CREATE              1  /* ADIO_CREATE */ 
  66. #define MPI_MODE_EXCL               64  /* ADIO_EXCL */
  67. #define MPI_MODE_DELETE_ON_CLOSE    16  /* ADIO_DELETE_ON_CLOSE */
  68. #define MPI_MODE_UNIQUE_OPEN        32  /* ADIO_UNIQUE_OPEN */
  69. #define MPI_MODE_APPEND            128  /* ADIO_APPEND */
  70. #define MPI_MODE_SEQUENTIAL        256  /* ADIO_SEQUENTIAL */
  71.  
  72. #define MPI_DISPLACEMENT_CURRENT   -54278278
  73.  
  74. #define MPI_FILE_NULL           ((MPI_File) 0)
  75. #define MPIO_REQUEST_NULL       ((MPIO_Request) 0)
  76.  
  77. #define MPI_SEEK_SET            600
  78. #define MPI_SEEK_CUR            602
  79. #define MPI_SEEK_END            604
  80.  
  81. #define MPI_MAX_DATAREP_STRING  128
  82.  
  83. #define MPI_ORDER_C             56
  84. #define MPI_ORDER_FORTRAN       57
  85. #define MPI_DISTRIBUTE_BLOCK    121
  86. #define MPI_DISTRIBUTE_CYCLIC   122
  87. #define MPI_DISTRIBUTE_NONE     123
  88. #define MPI_DISTRIBUTE_DFLT_DARG -49767
  89.  
  90.  
  91. /* MPI-IO function prototypes */
  92.  
  93. /* The compiler must support ANSI C style prototypes, otherwise 
  94.    long long constants (e.g. 0) may get passed as ints. */
  95.  
  96. #ifndef HAVE_PRAGMA_HP_SEC_DEF
  97.  
  98. /* Section 9.2 */
  99. int MPI_File_open(MPI_Comm comm, char *filename, int amode, 
  100.                           MPI_Info info, MPI_File *fh);
  101. int MPI_File_close(MPI_File *fh);
  102. int MPI_File_delete(char *filename, MPI_Info info);
  103. int MPI_File_set_size(MPI_File fh, MPI_Offset size);
  104. int MPI_File_preallocate(MPI_File fh, MPI_Offset size);
  105. int MPI_File_get_size(MPI_File fh, MPI_Offset *size);
  106. int MPI_File_get_group(MPI_File fh, MPI_Group *group);
  107. int MPI_File_get_amode(MPI_File fh, int *amode);
  108. int MPI_File_set_info(MPI_File fh, MPI_Info info);
  109. int MPI_File_get_info(MPI_File fh, MPI_Info *info_used);
  110.  
  111. /* Section 9.3 */
  112. int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype,
  113.              MPI_Datatype filetype, char *datarep, MPI_Info info);
  114. int MPI_File_get_view(MPI_File fh, MPI_Offset *disp, 
  115.                  MPI_Datatype *etype, MPI_Datatype *filetype, char *datarep);
  116.  
  117. /* Section 9.4.2 */
  118. int MPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf,
  119.           int count, MPI_Datatype datatype, MPI_Status *status);
  120. int MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf,
  121.           int count, MPI_Datatype datatype, MPI_Status *status);
  122. int MPI_File_write_at(MPI_File fh, MPI_Offset offset, void *buf,
  123.           int count, MPI_Datatype datatype, MPI_Status *status);
  124. int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, void *buf,
  125.           int count, MPI_Datatype datatype, MPI_Status *status);
  126.  
  127. /* nonblocking calls currently use MPIO_Request, because generalized
  128.    requests not yet implemented. For the same reason, MPIO_Test and 
  129.    MPIO_Wait are used to test and wait on nonblocking I/O requests */ 
  130.  
  131. int MPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf,
  132.           int count, MPI_Datatype datatype, MPIO_Request *request);
  133. int MPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, void *buf,
  134.           int count, MPI_Datatype datatype, MPIO_Request *request);
  135.  
  136. /* Section 9.4.3 */
  137. int MPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype
  138.          datatype, MPI_Status *status); 
  139. int MPI_File_read_all(MPI_File fh, void *buf, int count, MPI_Datatype
  140.          datatype, MPI_Status *status); 
  141. int MPI_File_write(MPI_File fh, void *buf, int count, MPI_Datatype
  142.           datatype, MPI_Status *status);
  143. int MPI_File_write_all(MPI_File fh, void *buf, int count, MPI_Datatype
  144.           datatype, MPI_Status *status);
  145.  
  146. /* nonblocking calls currently use MPIO_Request, because generalized
  147.    requests not yet implemented. For the same reason, MPIO_Test and 
  148.    MPIO_Wait are used to test and wait on nonblocking I/O requests */ 
  149.  
  150. int MPI_File_iread(MPI_File fh, void *buf, int count, MPI_Datatype
  151.          datatype, MPIO_Request *request); 
  152. int MPI_File_iwrite(MPI_File fh, void *buf, int count, MPI_Datatype
  153.           datatype, MPIO_Request *request);
  154.  
  155. int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence);
  156. int MPI_File_get_position(MPI_File fh, MPI_Offset *offset);
  157. int MPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, 
  158.                                      MPI_Offset *disp);
  159.  
  160. /* Section 9.4.4 */
  161. int MPI_File_read_shared(MPI_File fh, void *buf, int count, 
  162.                          MPI_Datatype datatype, MPI_Status *status);
  163. int MPI_File_write_shared(MPI_File fh, void *buf, int count, 
  164.                           MPI_Datatype datatype, MPI_Status *status);
  165. int MPI_File_iread_shared(MPI_File fh, void *buf, int count, 
  166.                           MPI_Datatype datatype, MPIO_Request *request);
  167. int MPI_File_iwrite_shared(MPI_File fh, void *buf, int count, 
  168.                            MPI_Datatype datatype, MPIO_Request *request);
  169. int MPI_File_read_ordered(MPI_File fh, void *buf, int count, 
  170.                           MPI_Datatype datatype, MPI_Status *status);
  171. int MPI_File_write_ordered(MPI_File fh, void *buf, int count, 
  172.                            MPI_Datatype datatype, MPI_Status *status);
  173. int MPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence);
  174. int MPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset);
  175.  
  176. /* Section 9.4.5 */
  177. int MPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf,
  178.                                int count, MPI_Datatype datatype);
  179. int MPI_File_read_at_all_end(MPI_File fh, void *buf, MPI_Status *status);
  180. int MPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf,
  181.                                 int count, MPI_Datatype datatype);
  182. int MPI_File_write_at_all_end(MPI_File fh, void *buf, MPI_Status *status);
  183. int MPI_File_read_all_begin(MPI_File fh, void *buf, int count, 
  184.                             MPI_Datatype datatype);
  185. int MPI_File_read_all_end(MPI_File fh, void *buf, MPI_Status *status);
  186. int MPI_File_write_all_begin(MPI_File fh, void *buf, int count, 
  187.                              MPI_Datatype datatype);
  188. int MPI_File_write_all_end(MPI_File fh, void *buf, MPI_Status *status);
  189. int MPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, 
  190.                                 MPI_Datatype datatype);
  191. int MPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status);
  192. int MPI_File_write_ordered_begin(MPI_File fh, void *buf, int count, 
  193.                                  MPI_Datatype datatype);
  194. int MPI_File_write_ordered_end(MPI_File fh, void *buf, MPI_Status *status);
  195.  
  196. /* Section 9.5.1 */
  197. int MPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, 
  198.                                      MPI_Aint *extent);
  199.  
  200. /* Section 9.6.1 */
  201. int MPI_File_set_atomicity(MPI_File fh, int flag);
  202. int MPI_File_get_atomicity(MPI_File fh, int *flag);
  203. int MPI_File_sync(MPI_File fh);
  204.  
  205.  
  206. /* Section 4.14.4 */
  207. int MPI_Type_create_subarray(int ndims, int *array_of_sizes, int
  208.                       *array_of_subsizes, int *array_of_starts, int order, 
  209.                       MPI_Datatype oldtype, MPI_Datatype *newtype);
  210.  
  211. /* Section 4.14.5 */
  212. int MPI_Type_create_darray(int size, int rank, int ndims, 
  213.                     int *array_of_gsizes, int *array_of_distribs, 
  214.                     int *array_of_dargs, int *array_of_psizes, 
  215.                     int order, MPI_Datatype oldtype, MPI_Datatype *newtype);
  216.  
  217. /* Section 4.12.4 */
  218. #ifdef MPI_File_f2c
  219. #undef MPI_File_f2c
  220. #endif
  221. #ifdef MPI_File_c2f
  222. #undef MPI_File_c2f
  223. #endif
  224. /* above needed for some versions of mpi.h in MPICH!! */
  225. MPI_File MPI_File_f2c(MPI_Fint fh);
  226. MPI_Fint MPI_File_c2f(MPI_File fh);
  227.  
  228.  
  229. /* The foll. functions are required, because an MPIO_Request object
  230.    is currently used for nonblocking I/O. These functions will go away
  231.    after generalized requests are implemented. */
  232. int MPIO_Test(MPIO_Request *request, int *flag, MPI_Status *status);
  233. int MPIO_Wait(MPIO_Request *request, MPI_Status *status);
  234. MPI_Fint MPIO_Request_c2f(MPIO_Request request);
  235. MPIO_Request MPIO_Request_f2c(MPI_Fint request);
  236.  
  237.  
  238. /* info functions if not defined in the MPI implementation */
  239. #ifndef __HAS_MPI_INFO
  240.  
  241. int MPI_Info_create(MPI_Info *info);
  242. int MPI_Info_set(MPI_Info info, char *key, char *value);
  243. int MPI_Info_delete(MPI_Info info, char *key);
  244. int MPI_Info_get(MPI_Info info, char *key, int valuelen, 
  245.                          char *value, int *flag);
  246. int MPI_Info_get_valuelen(MPI_Info info, char *key, int *valuelen, 
  247.                                   int *flag);
  248. int MPI_Info_get_nkeys(MPI_Info info, int *nkeys);
  249. int MPI_Info_get_nthkey(MPI_Info info, int n, char *key);
  250. int MPI_Info_dup(MPI_Info info, MPI_Info *newinfo);
  251. int MPI_Info_free(MPI_Info *info);
  252.  
  253. #ifdef MPI_Info_f2c
  254. #undef MPI_Info_f2c
  255. #endif
  256. #ifdef MPI_Info_c2f
  257. #undef MPI_Info_c2f
  258. #endif
  259. /* above needed for some versions of mpi.h in MPICH!! */
  260. MPI_Fint MPI_Info_c2f(MPI_Info info);
  261. MPI_Info MPI_Info_f2c(MPI_Fint info);
  262. #endif
  263.  
  264. #endif   /* HAVE_PRAGMA_HP_SEC_DEF */
  265.  
  266.  
  267. /**************** BINDINGS FOR THE PROFILING INTERFACE ***************/
  268.  
  269. /* Error definitions */
  270.  
  271. int MPI_File_get_errhandler(MPI_File fh, MPI_Errhandler *errhandler);
  272. int MPI_File_set_errhandler(MPI_File fh, MPI_Errhandler errhandler);
  273.  
  274. /* Section 9.2 */
  275. int PMPI_File_open(MPI_Comm comm, char *filename, int amode, 
  276.                            MPI_Info info, MPI_File *fh);
  277. int PMPI_File_close(MPI_File *fh);
  278. int PMPI_File_delete(char *filename, MPI_Info info);
  279. int PMPI_File_set_size(MPI_File fh, MPI_Offset size);
  280. int PMPI_File_preallocate(MPI_File fh, MPI_Offset size);
  281. int PMPI_File_get_size(MPI_File fh, MPI_Offset *size);
  282. int PMPI_File_get_group(MPI_File fh, MPI_Group *group);
  283. int PMPI_File_get_amode(MPI_File fh, int *amode);
  284. int PMPI_File_set_info(MPI_File fh, MPI_Info info);
  285. int PMPI_File_get_info(MPI_File fh, MPI_Info *info_used);
  286.  
  287. /* Section 9.3 */
  288. int PMPI_File_set_view(MPI_File fh, MPI_Offset disp, 
  289.     MPI_Datatype etype, MPI_Datatype filetype, char *datarep, MPI_Info info);
  290. int PMPI_File_get_view(MPI_File fh, MPI_Offset *disp, 
  291.       MPI_Datatype *etype, MPI_Datatype *filetype, char *datarep);
  292.  
  293. /* Section 9.4.2 */
  294. int PMPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf,
  295.           int count, MPI_Datatype datatype, MPI_Status *status);
  296. int PMPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf,
  297.           int count, MPI_Datatype datatype, MPI_Status *status);
  298. int PMPI_File_write_at(MPI_File fh, MPI_Offset offset, void *buf,
  299.           int count, MPI_Datatype datatype, MPI_Status *status);
  300. int PMPI_File_write_at_all(MPI_File fh, MPI_Offset offset, void *buf,
  301.           int count, MPI_Datatype datatype, MPI_Status *status);
  302.  
  303. /* nonblocking calls currently use MPIO_Request, because generalized
  304.    requests not yet implemented. For the same reason, MPIO_Test and 
  305.    MPIO_Wait are used to test and wait on nonblocking I/O requests */ 
  306.  
  307. int PMPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf,
  308.           int count, MPI_Datatype datatype, MPIO_Request *request);
  309. int PMPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, void *buf,
  310.           int count, MPI_Datatype datatype, MPIO_Request *request);
  311.  
  312. /* Section 9.4.3 */
  313. int PMPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype
  314.                            datatype, MPI_Status *status); 
  315. int PMPI_File_read_all(MPI_File fh, void *buf, int count, MPI_Datatype
  316.                            datatype, MPI_Status *status); 
  317. int PMPI_File_write(MPI_File fh, void *buf, int count, MPI_Datatype
  318.                         datatype, MPI_Status *status);
  319. int PMPI_File_write_all(MPI_File fh, void *buf, int count, MPI_Datatype
  320.                             datatype, MPI_Status *status);
  321.  
  322. /* nonblocking calls currently use MPIO_Request, because generalized
  323.    requests not yet implemented. For the same reason, MPIO_Test and 
  324.    MPIO_Wait are used to test and wait on nonblocking I/O requests */ 
  325.  
  326. int PMPI_File_iread(MPI_File fh, void *buf, int count, MPI_Datatype
  327.                         datatype, MPIO_Request *request); 
  328. int PMPI_File_iwrite(MPI_File fh, void *buf, int count, MPI_Datatype
  329.                          datatype, MPIO_Request *request);
  330.  
  331. int PMPI_File_seek(MPI_File fh, MPI_Offset offset, int whence);
  332. int PMPI_File_get_position(MPI_File fh, MPI_Offset *offset);
  333. int PMPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, 
  334.                                       MPI_Offset *disp);
  335.  
  336. /* Section 9.4.4 */
  337. int PMPI_File_read_shared(MPI_File fh, void *buf, int count, 
  338.                          MPI_Datatype datatype, MPI_Status *status);
  339. int PMPI_File_write_shared(MPI_File fh, void *buf, int count, 
  340.                           MPI_Datatype datatype, MPI_Status *status);
  341. int PMPI_File_iread_shared(MPI_File fh, void *buf, int count, 
  342.                           MPI_Datatype datatype, MPIO_Request *request);
  343. int PMPI_File_iwrite_shared(MPI_File fh, void *buf, int count, 
  344.                            MPI_Datatype datatype, MPIO_Request *request);
  345. int PMPI_File_read_ordered(MPI_File fh, void *buf, int count, 
  346.                           MPI_Datatype datatype, MPI_Status *status);
  347. int PMPI_File_write_ordered(MPI_File fh, void *buf, int count, 
  348.                            MPI_Datatype datatype, MPI_Status *status);
  349. int PMPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence);
  350. int PMPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset);
  351.  
  352. /* Section 9.4.5 */
  353. int PMPI_File_read_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf,
  354.                                int count, MPI_Datatype datatype);
  355. int PMPI_File_read_at_all_end(MPI_File fh, void *buf, MPI_Status *status);
  356. int PMPI_File_write_at_all_begin(MPI_File fh, MPI_Offset offset, void *buf,
  357.                                 int count, MPI_Datatype datatype);
  358. int PMPI_File_write_at_all_end(MPI_File fh, void *buf, MPI_Status *status);
  359. int PMPI_File_read_all_begin(MPI_File fh, void *buf, int count, 
  360.                             MPI_Datatype datatype);
  361. int PMPI_File_read_all_end(MPI_File fh, void *buf, MPI_Status *status);
  362. int PMPI_File_write_all_begin(MPI_File fh, void *buf, int count, 
  363.                              MPI_Datatype datatype);
  364. int PMPI_File_write_all_end(MPI_File fh, void *buf, MPI_Status *status);
  365. int PMPI_File_read_ordered_begin(MPI_File fh, void *buf, int count, 
  366.                                 MPI_Datatype datatype);
  367. int PMPI_File_read_ordered_end(MPI_File fh, void *buf, MPI_Status *status);
  368. int PMPI_File_write_ordered_begin(MPI_File fh, void *buf, int count, 
  369.                                  MPI_Datatype datatype);
  370. int PMPI_File_write_ordered_end(MPI_File fh, void *buf, MPI_Status *status);
  371.  
  372. /* Section 9.5.1 */
  373. int PMPI_File_get_type_extent(MPI_File fh, MPI_Datatype datatype, 
  374.                                       MPI_Aint *extent);
  375.  
  376. /* Section 9.6.1 */
  377. int PMPI_File_set_atomicity(MPI_File fh, int flag);
  378. int PMPI_File_get_atomicity(MPI_File fh, int *flag);
  379. int PMPI_File_sync(MPI_File fh);
  380.  
  381. #ifndef __HAS_MPI_DARRAY_SUBARRAY
  382. /* Section 4.14.4 */
  383. int PMPI_Type_create_subarray(int ndims, int *array_of_sizes, int
  384.                       *array_of_subsizes, int *array_of_starts, int order, 
  385.                       MPI_Datatype oldtype, MPI_Datatype *newtype);
  386.  
  387. /* Section 4.14.5 */
  388. int PMPI_Type_create_darray(int size, int rank, int ndims, 
  389.                     int *array_of_gsizes, int *array_of_distribs, 
  390.                     int *array_of_dargs, int *array_of_psizes, 
  391.                     int order, MPI_Datatype oldtype, MPI_Datatype *newtype);
  392. #endif
  393.  
  394. /* Section 4.12.4 */
  395. MPI_File PMPI_File_f2c(MPI_Fint fh);
  396. MPI_Fint PMPI_File_c2f(MPI_File fh);
  397.  
  398.  
  399. /* The foll. functions are required, because an MPIO_Request object
  400.    is currently used for nonblocking I/O. These functions will go away
  401.    after generalized requests are implemented. */
  402. int PMPIO_Test(MPIO_Request *request, int *flag, MPI_Status *status);
  403. int PMPIO_Wait(MPIO_Request *request, MPI_Status *status);
  404. MPI_Fint PMPIO_Request_c2f(MPIO_Request request);
  405. MPIO_Request PMPIO_Request_f2c(MPI_Fint request);
  406.  
  407.  
  408. /* info functions if not defined in the MPI implementation */
  409. #ifndef __HAS_MPI_INFO
  410.  
  411. int PMPI_Info_create(MPI_Info *info);
  412. int PMPI_Info_set(MPI_Info info, char *key, char *value);
  413. int PMPI_Info_delete(MPI_Info info, char *key);
  414. int PMPI_Info_get(MPI_Info info, char *key, int valuelen, 
  415.                          char *value, int *flag);
  416. int PMPI_Info_get_valuelen(MPI_Info info, char *key, int *valuelen, 
  417.                                   int *flag);
  418. int PMPI_Info_get_nkeys(MPI_Info info, int *nkeys);
  419. int PMPI_Info_get_nthkey(MPI_Info info, int n, char *key);
  420. int PMPI_Info_dup(MPI_Info info, MPI_Info *newinfo);
  421. int PMPI_Info_free(MPI_Info *info);
  422.  
  423. MPI_Fint PMPI_Info_c2f(MPI_Info info);
  424. MPI_Info PMPI_Info_f2c(MPI_Fint info);
  425. #endif
  426.  
  427. #if defined(__cplusplus)
  428. }
  429. #endif
  430.  
  431. #endif
  432.